﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SortGUI
{
static class ArrayMaker
    {
        //产生随机数组
        public static void randomArray(ref int[] alNum,int totalNum)
        {
            Random rnd = new Random();
            for (int i = 0; i < totalNum; i++)
            {
                int index = i + rnd.Next(totalNum - i);
                int temp = alNum[i];
                alNum[i] = alNum[index];
                alNum[index] = temp;
            }
        }
        //初始化数组
        public static void initArray(ref int[] alNum,int totalNum)
        {
            for (int i = 0;i < totalNum;i++)
                alNum[i] = i+1;
        }
    }
}
